from django.contrib import admin
from .models import Institution,Frequency,CustomizeCategory,Trade,Exchange,Product,Author
from .models import Report

@admin.register(Institution)
class InstitutionAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')

@admin.register(Frequency)
class FrequencyAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')

@admin.register(CustomizeCategory)
class CustomizeCategoryAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')


@admin.register(Trade)
class TradeAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')

@admin.register(Exchange)
class ExchangeAdmin(admin.ModelAdmin):
    list_display = ('code', 'name')

@admin.register(Product)
class ProductAdmin(admin.ModelAdmin):
    list_display = ( 'trade', 'exchange','code', 'name')

@admin.register(Author)
class AuthorAdmin(admin.ModelAdmin):
    list_display = ('id', 'name')


@admin.register(Report)
class ReportAdmin(admin.ModelAdmin):
    list_display = ('name', 'products','exchange','trade','costomize_category','tags','frequency','institution','report_date','upload_time')
    exclude = ('upload_time','download_count','byte_num')